package com.example.common.base;

import java.util.List;

import com.github.pagehelper.Page;

public class PagingQueryResult<T> {
    private Long totalCount;

    private List<T> data;

    public Long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public void setPageResult(Object pageResult) {

        Page<T> pageInfo = (Page<T>) pageResult;
        if (pageInfo != null) {
            this.totalCount = pageInfo.getTotal();
            this.data = pageInfo.getResult();
        }
    }
}
